package com.suzhe.ymall.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.suzhe.ymall.product.mapper.AttributeMapper;
import com.suzhe.ymall.product.pojo.Attribute;
import com.suzhe.ymall.product.service.IAttributeService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 商品属性表 服务实现类
 * </p>
 *
 * @author suzhe
 * @since 2019-07-09
 */
@Service
public class AttributeServiceImpl extends ServiceImpl<AttributeMapper, Attribute> implements IAttributeService {

    @Override
    public boolean saveOrUpdate(Attribute attribute) {
        if (attribute.getId() == null){
            save(attribute);
        }else {
            updateById(attribute);
        }
        return true;
    }
}
